







<div class="x-body">
    <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so">
            <input type="text" name="search_data"  placeholder="赌王名称|会员账号|UID" autocomplete="off" value="{:input('search_data')}"  class="layui-input">
            <input class="layui-input"  autocomplete="off" placeholder="开始日" name="date1"  value="{:input('date1')}" id="start">
            <input class="layui-input"  autocomplete="off" placeholder="截止日" name="date2"  value="{:input('date2')}" id="end">
            <button class="layui-btn"  id="search"  url="{:url('kinglist')}"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </form>
    </div>
    <xblock>
        <!--<button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon"></i>批量删除</button>-->
        <!--<ob_link><a  href="{:url('kingAdd')}" style="color: white">   <button class="layui-btn" >新 增</button></a></ob_link>-->
        <span class="x-right" style="line-height:40px">共有数据：{$list.count} 条</span>
    </xblock>
    <table class="layui-table x-admin">
        <thead>
        <tr>

            <th>序号</th>

            <th>赌王信息</th>
            <th>产品信息</th>
            <th>订单信息</th>
            <th>分红信息</th>
            <th>状态</th>
            <th>操作</th>
        </thead>
        {notempty name='list.list'}
        <tbody>
        {volist name='list.list' id='vo' key="k"}
        <tr>
            <!--<td>-->
                <!--<div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='{$vo.id}'><i class="layui-icon">&#xe605;</i></div>-->
            <!--</td>-->
            <td>{$k}</td>

            <td>
                <div><label>赌王名称:</label><span>{$vo.king.name}</span></div>

            </td>
            <td>

                <div>  <label>产品名称:</label><span>{$vo.investment.name}</span></div>
                <div>  <label>分红比例:</label><span>赌王：{$vo.investment.king_bonus}%   用户：{$vo.investment.user_bonus}%</span></div>
                <div><label>止损:</label><span>{$vo.investment.stop_loss_rate}%</span></div>
                <div><label>止赢:</label><span>{$vo.investment.winning_rate}%</span></div>
                <div><label>开始委托时间:</label><span>{$vo.start_time|date='Y-m-d H:i:s',###}</span></div>
                <div><label>结束委托时间:</label><span>{$vo.expire_time|date='Y-m-d H:i:s',###}</span></div>

            </td>
            <td>
            <div><label>总委人数:</label><span>{$vo.order_count}</span></div>
            <div><label>委托金额总数:</label><span>{$vo.total_money}</span></div>
            <div>  <label>可用金额:</label><span>{$vo.king_win_account}</span></div>
            <div>  <label>止损金额:</label><span>{$vo.stop_lose_account}</span></div>

            </td>
            <td>
                <div><label>赌王下注金额:</label><span>{$vo.king_bet_total}</span></div>
                <div><label>赌王亏损金额:</label><span>{$vo.king_reduce_total}</span></div>
                <div>  <label>委托人总下注金额:</label><span>{$vo.king_bet_total}</span></div>
                <div>  <label>委托人总亏损金额:</label><span>{$vo.king_reduce_total}</span></div>
                <div>  <label>中奖金额:</label><span>{$vo.reward_total}</span></div>
                <div>  <label>赌王分红:</label><span>{$vo.king_bonus_total}</span></div>
                <div>  <label>赌王社区贡献:</label><span>{$vo.king_area_total}</span></div>
                <div>  <label>委托社区贡献金额:</label><span>{$vo.user_area_total}</span></div>
                <div>  <label>委托社区人均贡献:</label><span>{if condition="$vo.order_count eq 0"}0{else/}{$vo.user_area_total/$vo.order_count}{/if}</span></div>

            </td>
            <td>
                <div><label>状态:</label><span> {$vo.state_text}{if condition ="$vo.is_stop_bets eq 1"}<span style="color: #f56c6c">(已停止下注)</span>{/if}</span></div>
            </td>

            <td class="td-manage">
                <div style="margin-bottom: 5px;"><label>查看委托人:</label><span>  <ob_link><a title="查看委托人"  href="{:url('king_order_list', array('user_investment_id' => $vo['id']))}" >
                    <i class="layui-icon">&#xe770;</i>
                </a></ob_link></span></div>
                {switch name="vo.state" }
                {case value="1"}
                <div style="margin-bottom: 5px;"><label>取消委托:</label><span>   <ob_link><a class="ajax-get layui-btn layui-btn-normal layui-btn-mini" href="{:url('king_investment_update', array('id' => $vo['id'], 'state' =>4))}">  取消委托</a></ob_link></span></div>

                {if condition="$vo.order_count gt 0"}
                <div style="margin-bottom: 5px;"><label>停止委托:</label><span>   <ob_link><a class="ajax-get layui-btn layui-btn-normal layui-btn-mini" href="{:url('king_investment_update', array('id' => $vo['id'], 'state' =>2))}">  停止委托</a></ob_link></span></div>
                {/if}

                {/case}
                {case value="2"}{/case}
                {case value="3"}
                <div style="margin-bottom: 5px;"><label></label><span>   <a title="手动分红" style="color: #0a8cd2"   href="javascript:reply({$vo['id']},6);" >
                    手动分红
                </a></span></div>
                <div style="margin-bottom: 5px;"><label>强制止损:</label><span>   <ob_link><a class="ajax-get layui-btn layui-btn-normal layui-btn-mini" href="{:url('king_investment_update', array('id' => $vo['id'], 'state' =>5))}">  强制止损</a></ob_link></span></div>
                {/case}
                {case value="4"}{/case}
                {case value="5"}{/case}

            {/switch}
            <!--<ob_link><a title="编辑"  href="{:url('kingEdit', array('id' => $vo['id']))}" >-->
                    <!--<i class="layui-icon">&#xe642;</i>-->
                <!--</a></ob_link>-->
                <!--<ob_link><a title="删 除" class="ajax-get"  href="{:url('setStatus', array('ids' => $vo['id'], 'status' => -1))}" >-->
                    <!--<i class="layui-icon">&#xe640;</i>-->
                <!--</a></ob_link>-->

            </td>
        </tr>
        {/volist}
        {else/}
        <tbody><tr class="odd"><td colspan="12" class="text-center" valign="top">{:config('empty_list_describe')}</td></tr></tbody>
        {/notempty}

        </tbody>
    </table>
    <div class="page">
        {notempty name='list'}   {$list.list->render()}{/notempty}
    </div>

</div>
<script>
    layui.use('laydate', function(){
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });
    });
    layui.use('form', function(){
        form = layui.form;

    });
    function reply(id ,state) {

        layer.open({
            type: 2 //此处以iframe举例
            ,title: '手动分红'
            ,area: ['50%', '70%']
            ,shade: 0
            ,maxmin: true
            ,content: "king_investment_update?id="+id+'&state='+state+'&otcorder=1'
            ,btn: [] //只是为了演示
        });



    }
</script>

</body>

</html>


